From 0415d2fb72d3e342de5d22698d93598892a45f4f Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 27 Feb 2009 00:48:03 +0000 Subject: [PATCH] (read_escape): Signal an error for invalid \UXXXXXXXX. --- src/lread.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lread.c b/src/lread.c index 063adba1d9a..e4ba5229e20 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2205,7 +2205,7 @@ read_escape (readcharfun, stringp) /* A Unicode escape. We only permit them in strings and characters, not arbitrarily in the source code, as in some other languages. */ { - int i = 0; + unsigned int i = 0; int count = 0; while (++count <= unicode_hex_count) @@ -2222,7 +2222,8 @@ read_escape (readcharfun, stringp) break; } } - + if (i > 0x10FFFF) + error ("Non-Unicode character: 0x%x", i); return i; } -- 2.30.2